package com.dashboard.cloud.common.dto;

import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: spring-cloud-dashboard
 * @Package: com.dashboard.cloud.common.dto
 * @ClassName: UserDTO
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/11/14 17:58
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Data
@NoArgsConstructor //
public class UserDTO implements Serializable {
    private static final long serialVersionUID = -5303658345093847416L;
    private Long userId;
    private String username;
    private String password;
    private String email;

    public static List<UserDTO> findAll() {
        return new ArrayList<UserDTO>() {
            private static final long serialVersionUID = 4177474165397228176L;

            {
                add(builder(1L,"tom1","a123456",""));
                add(builder(2L,"tom2","b123456",""));
                add(builder(3L,"tom3","c123456",""));
                add(builder(4L,"tom4","d123456",""));
                add(builder(5L,"tom5","e123456",""));

            }
        };
    }

    private static UserDTO builder(Long userId, String username, String password, String email ) {
        UserDTO userDTO = new UserDTO();
        userDTO.setUserId(userId);
        userDTO.setUsername(username);
        userDTO.setPassword(password);
        userDTO.setEmail(email);
        return userDTO;
    }
}